---
title: "Custom Properties"
description: "Helicone allows you to tag requests with any information you choose to segment, analyze, and visualize by."
---

### What are Custom Properties?

Custom Properties allow you to add any additional information to your requests, such as:

- The **session,** **conversation**, or **app** id
- The **prompt chain** by adding a common value to group of requests
- **Application** or **user** metadata making the request

### Use Custom Properties to

- Get the the total cost or latency for a group of requests in a prompt chain
- Get the "unit economics" of your application, such as the average cost of a conversation or session
- Slice and dice your requests and metrics by any custom property

<br />

<Accordion title="Adding Custom Properties at Request Time">

Custom properties can be added with headers to your LLM requests. For each header,

- The Key is `Helicone-Property-{Name}` with your property name in Name
- The Value is the string value for the property in the request.

<CodeGroup>

```bash Curl
curl https://oai.hconeai.com/v1/completions \
  -H 'Content-Type: application/json' \
  -H 'Helicone-Auth: Bearer HELICONE_API_KEY' \
  -H 'Helicone-Property-Session: "24"' \
  -H 'Helicone-Property-Conversation: "support_issue_2"' \
  -H 'Helicone-Property-App: "mobile"'
  -d ...
```

```python Python
openai.api_base = "https://oai.hconeai.com/v1"
openai

openai.Completion.create(
    model="text-davinci-003",
    prompt="Say this is a test",
    headers={
        "Helicone-Auth": f"Bearer {HELICONE_API_KEY}",
        "Helicone-Property-Session": "24",
        "Helicone-Property-Conversation": "support_issue_2",
        "Helicone-Property-App": "mobile",
    }
)
```

```js Node.js
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
  basePath: "https://oai.hconeai.com/v1",
  defaultHeaders: {
    "Helicone-Auth": f"Bearer {HELICONE_API_KEY}",
    "Helicone-Property-Session": "24",
    "Helicone-Property-Conversation": "support_issue_2",
    "Helicone-Property-App": "mobile",
  },
});
const openai = new OpenAIApi(configuration);
```

```python Langchain (Python)
llm = ChatOpenAI(
    openai_api_key="<OPENAI_API_KEY>",
    openai_api_base="https://oai.hconeai.com/v1",
    default_headers={
        "Helicone-Auth": "Bearer <HELICONE_API_KEY>"
        "Helicone-Property-Type": "Course Outline"
    }
)

course = llm.predict("Generate a course outline about AI.")

# Update helicone properties/headers for each request
headers["Helicone-Property-Type"] = "Lesson"
llm.model_kwargs["headers"] = headers

lesson = llm.predict("Generate a lesson for the AI course.")
```

</CodeGroup>
</Accordion>

<Accordion title="Updating Custom Properties After Request">
Helicone now allows you to update custom properties post-request submission by making a PUT request to a designated API endpoint.
```bash Curl
curl --request PUT \
  --url 'https://api.hconeai.com/v1/request/{request-id}/property' \
  --header 'Authorization: Bearer {your-helicone-api-key}' \
  --header 'Content-Type: application/json' \
  --data '{
    "key": "{property-key}",
    "value": "{new-property-value}"
}'
```
</Accordion>
